import java.util.Arrays;
import java.util.Scanner;

class P11455_39643 {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		
		int cases = scan.nextInt();//  Integer.parseInt(readLn());
		
		for (int k = 0 ; k < cases; k++) {
			
			
			long[] a = new long[4];
			
			a[0] = scan.nextLong(); //Long.parseLong(st.nextToken());
			a[1] = scan.nextLong(); //Long.parseLong(st.nextToken());
			a[2] = scan.nextLong(); //Long.parseLong(st.nextToken());
			a[3] = scan.nextLong(); // Long.parseLong(st.nextToken());
			
			Arrays.sort(a);
			
			if (a[3] >= a[2] + a[1] + a[0]) System.out.println("banana");
			else if (a[0] == a[1] && a[1] == a[2] && a[2] == a[3]) System.out.println("square");
			else if (a[0] == a[1] && a[2] == a[3]) System.out.println("rectangle");
			else System.out.println("quadrangle");
			
		}
		
	}

	static String readLn() {
		String newLine = System.getProperty("line.separator");
		StringBuilder buffer = new StringBuilder();
		int car = -1;
		try {
			car = System.in.read();
			while ((car > 0) && (car != newLine.charAt(0))) {
				buffer.append((char) car);
				car = System.in.read();
			}
			if (car == newLine.charAt(0))
				System.in.skip(newLine.length() - 1);
		} catch (java.io.IOException e) {
			return (null);
		}
		if ((car < 0) && (buffer.length() == 0))
			return (null);
		return (buffer.toString());
	}
}
